package com.tanhua.app.controller;

import com.tanhua.app.controllerservice.ShizhanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class ShizhanController {
    @Autowired
    private ShizhanService shizhanService;

    @PostMapping (value = "/peachblossom", name = "桃花传音--发送语音")
    public ResponseEntity sendVoice(MultipartFile soundFile) throws IOException {
        shizhanService.sendVoice(soundFile);
        return ResponseEntity.ok(null);
    }
    @GetMapping  (value = "/peachblossom", name = "桃花传音--接收语音")
    public ResponseEntity receiveVoice(){
        return shizhanService.receiveVoice();
    }
}
